package com.common.retrofit.methods;

import com.common.retrofit.base.BaseMethods;
import com.common.retrofit.entity.result.NewHouseInfoBean;
import com.common.retrofit.service.HaiNingService;

import java.util.List;

import rx.Observable;
import rx.Subscriber;

public class CollectionOrNotMethods extends BaseMethods {

    private static CollectionOrNotMethods m_ins = null;

    public static CollectionOrNotMethods getInstance() {
        if (m_ins == null) {
            synchronized (CollectionOrNotMethods.class) {
                if (m_ins == null) {
                    m_ins = new CollectionOrNotMethods();
                }
            }
        }
        return m_ins;
    }

    @Override
    protected String getHttpUrl() {
        return "House/";
    }

    private HaiNingService initService() {
        return getRetrofit().create(HaiNingService.class);
    }

    // 收藏取消收藏房源
    public void house_collection(Subscriber<List> subscriber, String uid, String type, String loupan_id, String huxing_id , String my_house_type ) {
        Observable observable = initService().house_collection(System.currentTimeMillis()+"",
                "8fbe1d7cb4a1779840a7119578ae20d6",uid,type,loupan_id,huxing_id,my_house_type
        );
        toSubscribe(observable, subscriber);
    }
}
